package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.admin.wap.service.StatsCustomerService;
import com.huilian.iotbox.admin.wap.service.StatsStoreService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.StatsStoreDto;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LinYinDong
 * @date 2023/8/3 16:37
 */
@RestController
@RequestMapping("/api/statsCustomerData")
public class StatsCustomerController extends UserInfoController{
    @Autowired
    private StatsCustomerService statsCustomerService;

    @PostMapping("/findStoreCustomer")
    public ServerResponse findStoreCustomer(HttpServletRequest request, @RequestBody StatsStoreDto statsStoreDto) {
        UserInfo userInfo = super.getLoginUserInfo(request);
        statsStoreDto.setUserInfo(userInfo);
        return ServerResponse.createBySuccess(statsCustomerService.findStoreCustomer(statsStoreDto));
    }
}
